﻿namespace EasyWeb.Web
{
    using System.Web.Mvc;

    public class EWAdminAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get { return "EasyWeb"; }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "EasyWeb_Admin",
                "EasyWeb/Admin/{action}",
                new { controller = "EWAdmin", action = "Index" }
            );

            context.MapRoute(
                "EasyWeb_Configuration",
                "EasyWeb/Configuration/{action}",
                new { controller = "EWConfiguration" }
            );

            context.MapRoute(
                "EasyWeb_Entity",
                "EasyWeb/Entity/{action}/{id}",
                new { controller = "EWEntity", action = "Index", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "EasyWeb_Field",
                "EasyWeb/Field/{action}/{ownerId}/{id}",
                new { controller = "EWField", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "EasyWeb_Selection",
                "EasyWeb/Selection/{action}/{id}",
                new { controller = "EWSelection", action = "Index", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "EasyWeb_SelectionItem",
                "EasyWeb/SelectionItem/{action}/{ownerId}/{id}",
                new { controller = "EWSelectionItem", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "EasyWeb_Default",
                "EasyWeb/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}
